import { UserService } from '../../share/service/user.service';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-navigation',
  templateUrl: './navigation.component.html',
  styleUrls: ['./navigation.component.css']
})
export class NavigationComponent implements OnInit {

   constructor(
    private userService: UserService,
    private router: Router) {
  }

  ngOnInit() {
  }
  
  logout() {
    this.userService.cleanUser();
    this.router.navigate(['/login']);
    alert('logout success');
  }
  home(){
     this.router.navigate(['/home']);
  }
  shoppingCart(){
    this.router.navigate(['/shopping-cart']);
  }
}
